package com.zzyl.test;

import cn.hutool.core.date.LocalDateTimeUtil;
import org.junit.Test;

import java.time.LocalDate;
import java.time.LocalDateTime;

public class DateTesyt {

    @Test
    public void dateTest(){
        /*long start = 1721836800000L;
        long end = 1721923199999L;

        LocalDateTime s = LocalDateTimeUtil.of(start);
        LocalDateTime e = LocalDateTimeUtil.of(end);
        System.out.println(s);
        System.out.println(e);*/

        LocalDate s = LocalDate.of(2022, 1, 1);
        LocalDate e = LocalDate.of(2022, 12, 31);
        LocalDate alarm = LocalDate.of(2022, 5, 1);
        // After 之后
        System.out.println(s.isAfter(alarm));
        // Before 之前    e在 alarm 之前
        System.out.println(e.isBefore(alarm));
        /*if(s.isAfter(alarm) || e.isBefore(alarm)){
            System.out.println("true");
        }else{
            System.out.println(false);
        }*/
    }
}
